package cn.w2.demo1.aio.server;

import cn.w2.demo1.aio.ChannelInitializer;

import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.charset.Charset;
import java.util.concurrent.TimeUnit;

public class AioServerChannelInitializer extends ChannelInitializer {
	@Override
	protected void initChannel(AsynchronousSocketChannel channel) throws Exception {
		channel.read(ByteBuffer.allocate(1024), 10, TimeUnit.SECONDS, null,
				new AioServerHandler(channel, Charset.forName("GBK")));
	}
}
